home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CPPWIN10.ARJ / CAPPL.HPP next >
C/C++ Source or Header  |  1991-01-11  |  2KB  |  71 lines

  1. /***
  2.     CAppl class header file.
  3.     The is the application class. Only one of these is included
  4.     for each application.
  5. Revisions:
  6. 10/22/90 KM Initial coding.
  7. ***/
  8.  
  9. #include "cwind.hpp"
  10. #include "cbuffer.hpp"
  11.  
  12. #ifndef CAppl_INC
  13. #define CAppl_INC
  14.  
  15. class CAppl {
  16.     public: 
  17.             // void constructor
  18.         CAppl(HANDLE hI, HANDLE hP, HWND hWnd);
  19.             // Run the program.
  20.         WORD Run();
  21.             // Return the current instance
  22.         HANDLE    GetInst(void) { return hInst; };
  23.             // Return the previous instance
  24.         HANDLE    GetPrevInst(void) { return hPrev; };
  25.             // Set the application icon
  26.         BOOL SetAppIcon(LPSTR pIconName);
  27.             // Set the application Menu
  28.         BOOL SetAppMenu(LPSTR pMenuName);
  29.             // Set the application accelerator table
  30.         BOOL SetAccelerator(LPSTR pAccelName);
  31.  
  32.             // Menu operations
  33.         void EnableMenu(WORD wItem)
  34.             { EnableMenuItem(ApplMenu, wItem, MF_ENABLED); }
  35.         void DisableMenu(WORD wItem)
  36.             { EnableMenuItem(ApplMenu, wItem, MF_DISABLED); }
  37.         void GrayMenu(WORD wItem)
  38.             { EnableMenuItem(ApplMenu, wItem, MF_GRAYED); }
  39.         void CheckMenu(WORD wItem)
  40.             { CheckMenuItem(ApplMenu, wItem, MF_CHECKED); }
  41.         void UnCheckMenu(WORD wItem)
  42.             { CheckMenuItem(ApplMenu, wItem, MF_UNCHECKED); }
  43.         void InsertMenuItem(WORD wPos, WORD wFlags, WORD wItem, LPSTR pText)
  44.             { InsertMenu(ApplMenu, wPos, wFlags, wItem, pText); }
  45.         void AppendMenuItem(WORD wFlags, WORD wItem, LPSTR pText)
  46.             { AppendMenu(ApplMenu, wFlags, wItem, pText); }
  47.         void DeleteMenuItem(WORD wPos, WORD wFlags)
  48.             { DeleteMenu(ApplMenu, wPos, wFlags); }
  49.  
  50.             // Handle to the top most window.
  51.         HWND hTopWin;
  52.  
  53.             // True if Msg was a dlg msg
  54.         static BOOL bDlgMsg;
  55.  
  56.             // Handle to menu for application
  57.         HMENU ApplMenu;
  58.  
  59.     private :
  60.         HANDLE    hInst;                // Handle to instance
  61.         HANDLE    hPrev;                // Handle to prev instance
  62.         HANDLE    hAccTable;            // Accelerator table handle
  63.  
  64.     protected :
  65.         ~CAppl();
  66.         CBuffer *pcDlgList;         // List of modeless dialogs active.
  67.             // Check if message belongs to a modeless dialog.
  68.         BOOL ChkForDlgMsg(MSG *pMsg);
  69. };
  70. #endif
  71.